String.prototype.endWith = function(endStr) {
	var d = this.length - endStr.length;
	return(d >= 0 && this.lastIndexOf(endStr) == d);
}
var videos = document.getElementsByTagName("video");
for(let video of videos){
	var url = video.src;
	if(!url){
		continue;
	}
	if(!url.endWith(".m3u8") && !url.endWith(".flv")) {
		continue;
	}
	//console.log(url);
	var hls = new Hls();
	hls.loadSource(url);
	hls.attachMedia(video);
}
